CC=gcc
INCLUDE_PATHS =-I.
CFLAGS=

BUILD_DIR=build

LIB_NAME=mathlib

SHARED_MAIN=main_shared

LIB_OBJS = \

DEPS = \

%.o: %.c $(DEPS)
	@$(CC) -c -fPIC -o $(BUILD_DIR)/$@ $< $(CFLAGS) 

.PHONY:  main_shared clean
all: main_shared 

main_shared: shared_lib
	@echo "    Compiling main as shared binary..."
	@echo gcc main.c -o $(SHARED_MAIN) -L. -l$(LIB_NAME)
	@gcc main.c -o $(SHARED_MAIN) -L. -l$(LIB_NAME)
	@echo "    Created [ $(SHARED_MAIN) ] ] of size `ls -l $(SHARED_MAIN) | awk '{print $$5}'`"
	@echo "    $(SHARED_MAIN) uses the following shared libraries..."
	@ldd $(SHARED_MAIN)
	@echo ""

clean:
	@rm -f $(BUILD_DIR)/*.o *~ core *.a *_linked libmy_math*
	@echo "    Cleaning directories and object files."
